package com.youlian.cloud.gateway.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 调试容器
 *
 * @author : liukx
 * @create : 2018/9/25 14:46
 * @email : liukx@elab-plus.com
 */
public class DebugUtils {

    public static final String OUT_REQUEST = "LOGGER_REQUEST";
    public static final String OUT_REQUEST_HEADER = "OUT_REQUEST_HEADER";

    public static final String OUT_RESPONSE = "LOGGER_RESPONSE";

    private static Map<String, Boolean> debugUtils = new HashMap<>();

    public static Map<String, Boolean> getDebugUtils() {
        return debugUtils;
    }

    public static boolean getValue(String key) {
        Boolean bool = debugUtils.get(key);
        return bool == null ? true : bool;
    }

    public static boolean putValue(String key, boolean value) {
        Boolean result = debugUtils.put(key, value);
        return result == null ? true : result;
    }

    public static void clear() {
        debugUtils.clear();
    }
}
